//
//  ReadContentViewController.m
//  NeteaseNews
//
//  Created by liutaifeng on 16/4/20.
//  Copyright © 2016年 liutaifeng. All rights reserved.
//

#import "ReadContentViewController.h"
#import "LTFReadContentView.h"
@interface ReadContentViewController ()
@property (nonatomic, retain) UIView *myView;
@property (nonatomic, retain) UIButton *backButton;
@end

@implementation ReadContentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createView];
}
- (void)createView {
    LTFReadContentView *contentView = [[LTFReadContentView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64)];
    [self.view addSubview:contentView];
    contentView.string = self.string;
    [contentView release];
    
    self.myView = [[UIView alloc] initWithFrame:CGRectMake(0, 24, self.view.frame.size.width, 40)];
    
    _myView.backgroundColor = [UIColor whiteColor];
    
    self.backButton = [UIButton buttonWithType:UIButtonTypeSystem];
    _backButton.frame = CGRectMake(0, 0, 40, 40);
    [_backButton setImage:[UIImage imageNamed:@"fanhui.png"] forState:UIControlStateNormal];
    [_myView addSubview:_backButton];
    _backButton.tintColor = [UIColor lightGrayColor];
    [_backButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
}
- (void)viewWillAppear:(BOOL)animated {
    [self.navigationController.view addSubview:_myView];
}
- (void)viewWillDisappear:(BOOL)animated {
    [self.myView removeFromSuperview];
}

- (void)click:(UIButton *)button {
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
